//
//  parameterBuilder.m
//  PlayBall
//
//  Created by Edward Zhang on 12-5-20.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "JddParameterBuilder.h"
#import "SBJson.h"
#import "JddUserProfile.h"
#import "JddDefine.h"
#import "JddCommonFunction.h"
#import "JSONKit.h"
#include <sys/types.h>
#include <sys/sysctl.h>
#import "JddSFHFKeychainUtils.h"
#import "AppDelegate.h"

@implementation JddParameterBuilder

+(NSString *)buildParameterWithParameterJsonByOrgJdd:(NSString *)parameterValue actionCode:(NSString *)actionCode{
//    NSString *userId = [JddUserProfile sharedInstance].userId;
//    if (userId == nil) {
//        userId = @"";
//    }
    NSString *userId = @"";
    NSString *signSource = [NSString stringWithFormat:@"%@%@%@%@%@%@",
                            [[JddUserProfile sharedInstance] macAddress],
                            GLOBAL_PLATFORM,
                            [[UIDevice currentDevice] systemVersion],
                            [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleShortVersionString"],
                            parameterValue,
                            GLOBAL_SIGN_KEY];
    NSString *paramentChangeValue = [parameterValue stringByReplacingOccurrencesOfString:@"+" withString:@"%2B"];
    NSString *shopID = [JddUserProfile sharedInstance].shopID;
    NSString *test = [NSString stringWithFormat:@"uuid=%@&platformCode=%@&platformVersion=%@&appVersion=%@&action=%@&LSID=%@&sign=%@&UserId=%@&params=%@",
                      [[JddUserProfile sharedInstance] macAddress],
                      GLOBAL_PLATFORM,
                      [[UIDevice currentDevice] systemVersion],
                      [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleShortVersionString"],
                      actionCode,
                      (shopID ? shopID : @""),
                      [[signSource my32Md5] uppercaseString], userId,
                      paramentChangeValue];
    // NSLog(@"============%@",test);
    return test;
}

//构造参数及参数解析
+(NSString*)buildParameterWithParameterJson:(NSString*)parameterValue actionCode:(NSString*)actionCode
{
    NSString *userId = [JddUserProfile sharedInstance].userId;
    if (userId == nil) {
        userId = @"";
    }
    NSString *signSource = [NSString stringWithFormat:@"%@%@%@%@%@%@",
                            [[JddUserProfile sharedInstance] macAddress],
                            GLOBAL_PLATFORM,
                            [[UIDevice currentDevice] systemVersion],
                            [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleShortVersionString"],
                            parameterValue,
                            GLOBAL_SIGN_KEY];
    NSString *paramentChangeValue = [parameterValue stringByReplacingOccurrencesOfString:@"+" withString:@"%2B"];
    NSString *shopID = [JddUserProfile sharedInstance].shopID;
    NSString *test = [NSString stringWithFormat:@"uuid=%@&platformCode=%@&platformVersion=%@&appVersion=%@&action=%@&LSID=%@&sign=%@&UserId=%@&params=%@",
                      [[JddUserProfile sharedInstance] macAddress],
                      GLOBAL_PLATFORM,
                      [[UIDevice currentDevice] systemVersion],
                      [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleShortVersionString"],
                      actionCode,
                      (shopID ? shopID : @""),
                      [[signSource my32Md5] uppercaseString], userId,
                      paramentChangeValue];
        NSLog(@"============%@",test);
                      return test;
}

+(NSString *)buildScoreParameterWithParameterLastTime:(NSString *)lastTime AndLotterId:(NSString *)lotterId
{
    NSString *action = @"mobilpartmatchs";
    if ([lastTime isEqualToString:@"-1"]) {
        lastTime = @"";
        action = @"mobilallmatchs";
    }else{
        lastTime = [NSString stringWithFormat:@"&lastTime=%@", lastTime];
    }
    NSString *signSource = [NSString stringWithFormat:@"%@%@%@%@%@",
                            [[JddUserProfile sharedInstance] macAddress],
                            GLOBAL_PLATFORM,
                            [[UIDevice currentDevice] systemVersion],
                            [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleShortVersionString"],
                            GLOBAL_SIGN_KEY];
    NSString *platformVersion = [[UIDevice currentDevice] systemVersion];
    NSString *appVersion = [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleShortVersionString"];
    NSString *uuid = [[JddUserProfile sharedInstance] macAddress];
    NSString *sign = [[signSource my32Md5] uppercaseString];
    NSString *shopID = [JddUserProfile sharedInstance].shopID;
    NSString *str = [NSString stringWithFormat:@"platformCode=%@%@&LotteryId=%@&platformVersion=%@&action=%@&LSID=%@&appVersion=%@&uuid=%@&sign=%@",
           GLOBAL_PLATFORM,
           lastTime,
           lotterId,
           platformVersion,
           action,
           (shopID ? shopID : @""),
           appVersion,
           uuid,
           sign];
    
    return str;
}
//获取用户信息参数
+(NSString*)getUserInfoParameter
{
    NSMutableDictionary *dictionaryRegister = [NSMutableDictionary dictionaryWithCapacity:2];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryRegister];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"107"];    
}

//获取用户所属彩店信息
+(NSString*)getLotteryShopInfoParameter
{
    NSMutableDictionary *dictionaryRegister = [NSMutableDictionary dictionaryWithCapacity:2];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryRegister];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"1011"];
}

+(NSString*)queryProvinceListParameter
{
    NSMutableDictionary *dictionaryRegister = [NSMutableDictionary dictionaryWithCapacity:2];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryRegister];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"11"];    
}

+(NSString*)queryBankListParameter
{
    NSMutableDictionary *dictionaryRegister = [NSMutableDictionary dictionaryWithCapacity:2];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryRegister];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"13"];    
}

+(NSString*)queryCityListParameterOfProvince:(int)province
{
    NSMutableDictionary *dictionaryRegister = [NSMutableDictionary dictionaryWithCapacity:2];
    [dictionaryRegister setObject:[NSNumber numberWithInt:province] forKey:@"ProID"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryRegister];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"12"];    
}

+(NSString*)registerParameterWithUserName:(NSString*)userName userPassword:(NSString*)password cmdID:(NSInteger)cmdid
{
    NSMutableDictionary *dictionaryRegister = [NSMutableDictionary dictionaryWithCapacity:2];
    [dictionaryRegister setObject:userName forKey:@"Name"];
    [dictionaryRegister setObject:password forKey:@"Pw"];
    [dictionaryRegister setObject:[NSNumber numberWithInt:cmdid] forKey:@"CmdID"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryRegister];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"100"];
}
//版本更新提示接口
+(NSString *)updateVersionWidthID:(NSString*)cmdID
{
    NSMutableDictionary *dictionaryRegister = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryRegister setObject:cmdID forKey:@"CmdID"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryRegister];
    NSLog(@"parameterValue = %@",parameterValue);
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"2"];
}
//登录参数设置
+(NSString*)logonParameterWithUserName:(NSString*)userName userPassword:(NSString*)password
{
    NSMutableDictionary *dictionaryLogon = [NSMutableDictionary dictionaryWithCapacity:2];
    [dictionaryLogon setObject:userName forKey:@"Name"];
    [dictionaryLogon setObject:password forKey:@"Pw"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryLogon];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"101"];
}

+(NSString*)getVerifyCodeParameterWithMobile:(NSString*)mobile oldMobile:(NSString *)oldMobile
{
    NSMutableDictionary *dictionaryMobile = [NSMutableDictionary dictionaryWithCapacity:3];
    if ([oldMobile length] != 0) {
        [dictionaryMobile setObject:oldMobile forKey:@"OldMobile"];
    }
    [dictionaryMobile setObject:mobile forKey:@"Mobile"];

    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryMobile];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"103"];
}

+(NSString*)bindMobileParameterWithMobile:(NSString*)mobile verifyCode:(NSString*)verifyCode
{
    NSMutableDictionary *dictionaryMobile = [NSMutableDictionary dictionaryWithCapacity:3];
//    [dictionaryMobile setObject:mobile forKey:@"Mobile"];
    [dictionaryMobile setObject:verifyCode forKey:@"PhoneCode"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryMobile];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"104"];
}

+(NSString*)updateUserBaseInfoParameterWithRealName:(NSString*)realName idcard:(NSString*)idcard mobile:(NSString*)mobile
{
    NSMutableDictionary *dictionaryMobile = [NSMutableDictionary dictionaryWithCapacity:4];
    [dictionaryMobile setObject:realName forKey:@"RName"];
    [dictionaryMobile setObject:idcard forKey:@"IDCard"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryMobile];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"102"];
}

+(NSString*)queryBranchBankListParameterOfCity:(NSString*)city bank:(NSString*)bank
{
    NSMutableDictionary *dictionaryBranchBank = [NSMutableDictionary dictionaryWithCapacity:4];
    [dictionaryBranchBank setObject:[JddUserProfile sharedInstance].name forKey:@"Name"];
    [dictionaryBranchBank setObject:[JddUserProfile sharedInstance].password forKey:@"Password"];
    [dictionaryBranchBank setObject:city forKey:@"City"];
    [dictionaryBranchBank setObject:bank forKey:@"Bank"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryBranchBank];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"112"];
}

+(NSString*)bindCardOfProvince:(NSString*)province city:(NSString*)city bank:(NSString*)bankName cardNumber:(NSString*)cardNumber bankId:(int)bankId realityName:(NSString *)realityName
{
    NSMutableDictionary *dictionaryBindCard = [NSMutableDictionary dictionaryWithCapacity:6];
    [dictionaryBindCard setObject:bankName forKey:@"BankName"];
    [dictionaryBindCard setObject:cardNumber forKey:@"BankCardNumber"];
    [dictionaryBindCard setObject:province forKey:@"ProvinceName"];
    [dictionaryBindCard setObject:city forKey:@"CityName"];
    [dictionaryBindCard setObject:realityName forKey:@"RealityName"];
    [dictionaryBindCard setObject:[NSNumber numberWithInt:bankId] forKey:@"BankTypeID"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryBindCard];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"105"];
}

+(NSString*)modifyPasswordWithOld:(NSString*)oldPassword password:(NSString*)newPassowrd
{
    NSMutableDictionary *dictionaryBindCard = [NSMutableDictionary dictionaryWithCapacity:4];
    [dictionaryBindCard setObject:oldPassword forKey:@"oldPw"];
    [dictionaryBindCard setObject:newPassowrd forKey:@"newPw"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryBindCard];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"106"];
}

+(NSString*)queryAccountDetailForPageNo:(NSInteger)pageNo pageSize:(NSInteger)pageSize type:(NSInteger)type timeResion:(NSInteger)timeResion;
{
    NSMutableDictionary *dictionaryBindCard = [NSMutableDictionary dictionaryWithCapacity:5];
    [dictionaryBindCard setObject:[NSNumber numberWithInt:timeResion] forKey:@"TimeRegion"];
    [dictionaryBindCard setObject:[NSNumber numberWithInt:type] forKey:@"Type"];
    [dictionaryBindCard setObject:[NSNumber numberWithInt:pageNo] forKey:@"PageNo"];
    [dictionaryBindCard setObject:[NSNumber numberWithInt:pageSize] forKey:@"PageSize"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryBindCard];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"110"];
}

+(NSString*)queryDigitalLotteryIssueOfTypeId:(NSString*)lotteryTypeId
{
    NSMutableDictionary *dictionaryBindCard = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryBindCard setObject:lotteryTypeId forKey:@"LottID"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryBindCard];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"201"];
}

+(NSString*)queryDiscountOfTypeId:(NSNumber*)lotteryTypeId moneyAmount:(NSNumber*)moneyAmount castTypeNo:(NSNumber*)castTypeNo
{
    NSMutableDictionary *dictionaryBindCard = [NSMutableDictionary dictionaryWithCapacity:5];
    [dictionaryBindCard setObject:[JddUserProfile sharedInstance].name forKey:@"Name"];
    [dictionaryBindCard setObject:[JddUserProfile sharedInstance].password forKey:@"Password"];
    [dictionaryBindCard setObject:lotteryTypeId forKey:@"LotID"];
    [dictionaryBindCard setObject:castTypeNo forKey:@"CastType"];
    [dictionaryBindCard setObject:moneyAmount forKey:@"BuyMoney"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryBindCard];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"203"];
}

+(NSString*)querySportLotteryIssue:(NSString *)actionID
{
    NSMutableDictionary *dictionarySport = [NSMutableDictionary dictionaryWithCapacity:0];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionarySport];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:actionID];
}

+(NSString*)querySportLotteryIssue:(NSString*) actionID AndLottID :(int)lottID
{
    NSMutableDictionary *dictionarySport = [NSMutableDictionary dictionaryWithCapacity:0];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    [dictionarySport setObject:[NSNumber numberWithInt:lottID] forKey:@"LottID"];

    NSString *parameterValue = [jsonWriter stringWithObject:dictionarySport];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:actionID];  
}

+(NSString *)querylunboIssue:(NSString *)actionID AndLSID:(int)LSID
{
    NSMutableDictionary *dictionarySport = [NSMutableDictionary dictionaryWithCapacity:0];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    [dictionarySport setObject:[NSNumber numberWithInt:LSID] forKey:@"LSID"];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionarySport];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:actionID];
    }

+(NSString *)querycaizhongIssue:(NSString *)actionID
{
    NSMutableDictionary *caizhong = [NSMutableDictionary dictionaryWithCapacity:0];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:caizhong];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:actionID];
}

+(NSString *)querygeturlewm:(NSString *)actionID
{
    NSMutableDictionary *caizhong = [NSMutableDictionary dictionaryWithCapacity:0];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:caizhong];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:actionID];
}
+(NSString*)queryLotteryHallOpertaion
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:0];
    [dictionaryDraw setObject:@"0" forKey:@"LottID"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"123"];
}

+(NSString*)buyLotteryOfTypeId:(NSNumber*)lotteryTypeId
                       issueId:(NSNumber*)issueId 
                      multiple:(NSNumber*)multiple 
                   moneyAmount:(NSNumber*)moneyAmount
                 lotteryNumber:(NSMutableArray *)lotteryNumber
{
    NSMutableDictionary *dictionaryBindCard = [NSMutableDictionary dictionaryWithCapacity:11];
    [dictionaryBindCard setObject:@"1" forKey:@"SchemeType"];
    [dictionaryBindCard setObject:@"1" forKey:@"BetType"];
    [dictionaryBindCard setObject:@"0" forKey:@"BonusScale"];
    [dictionaryBindCard setObject:@"0" forKey:@"AssureShare"];
    [dictionaryBindCard setObject:@"" forKey:@"Description"];
    [dictionaryBindCard setObject:@"" forKey:@"OpenUserList"];
    [dictionaryBindCard setObject:@"4" forKey:@"SecrecyLevel"];
    [dictionaryBindCard setObject:moneyAmount forKey:@"BuyShare"];
    
    [dictionaryBindCard setObject:lotteryNumber forKey:@"Number"];
    
    [dictionaryBindCard setObject:lotteryTypeId forKey:@"LotteryID"];
    [dictionaryBindCard setObject:issueId forKey:@"IssueID"];
    [dictionaryBindCard setObject:multiple forKey:@"Multiple"];
    [dictionaryBindCard setObject:moneyAmount forKey:@"Money"];
    
    //添加一个接口,用于适配是否是ios请求的
    //deviceType = ios
    [dictionaryBindCard setObject:@"ios" forKey:@"deviceType"];

    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryBindCard];

    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"207"]; //207  211
}

+(NSString*)queryWithDrawOfMoney:(NSString *)Money pwd:(NSString *)pwd
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:4];
    [dictionaryDraw setObject:[NSNumber numberWithInt:[Money intValue]] forKey:@"Money"];
    [dictionaryDraw setObject:pwd forKey:@"PayPw"];
    [dictionaryDraw setObject:[NSNumber numberWithInt:[[JddUserProfile sharedInstance].BankID intValue]] forKey:@"BankID"];
    [dictionaryDraw setObject:[JddUserProfile sharedInstance].BandID forKey:@"BindID"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"109"]; 
}
//信用卡的请求上传
+(NSString *)queryUmOperation:(NSString *)BankPay money:(NSNumber *)money
{ AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
    NSInteger i;
    if (
        [appDelegate.moneyNum isEqualToString:@"98"]   ||
        [appDelegate.moneyNum isEqualToString:@"998"]  ||
        [appDelegate.moneyNum isEqualToString:@"9998"] ||
        [appDelegate.moneyNum isEqualToString:@"29998"]||
        [appDelegate.moneyNum isEqualToString:@"59998"]||
        [appDelegate.moneyNum isEqualToString:@"99998"]) {
        i = 6;
    }else{
        i = 4;
    }

    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:i];
    [dictionaryDraw setObject:[JddUserProfile sharedInstance].name forKey:@"Name"];
    [dictionaryDraw setObject:[JddUserProfile sharedInstance].password forKey:@"Password"];
    [dictionaryDraw setObject:@"Um_mobile" forKey:@"BankPay"];
    [dictionaryDraw setObject:money forKey:@"PayMoney"];
    if ([appDelegate.moneyNum isEqualToString:@"98"]){
        [dictionaryDraw setObject:@"3" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"998"]){
        [dictionaryDraw setObject:@"4" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"9998"]){
        [dictionaryDraw setObject:@"5" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"29998"]){
        [dictionaryDraw setObject:@"6" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"59998"]){
        [dictionaryDraw setObject:@"7" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"99998"]){
        [dictionaryDraw setObject:@"8" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }

    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    if (i == 4) {
        return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"108"];
    }else{
        return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"1082"];
    }
    
}
//支付宝的请求上传
+(NSString*)queryAlipayOperation:(NSString *)Bank money:(NSNumber *)money
{
    AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
    NSInteger i;
    if ([appDelegate.moneyNum isEqualToString:@"100"]  ||
        [appDelegate.moneyNum isEqualToString:@"1000"] ||
        [appDelegate.moneyNum isEqualToString:@"98"]   ||
        [appDelegate.moneyNum isEqualToString:@"998"]  ||
        [appDelegate.moneyNum isEqualToString:@"9998"] ||
        [appDelegate.moneyNum isEqualToString:@"29998"]||
        [appDelegate.moneyNum isEqualToString:@"59998"]||
        [appDelegate.moneyNum isEqualToString:@"99998"]) {
        i = 6;
    }else{
        i = 4;
    }
    
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:i];
    [dictionaryDraw setObject:[JddUserProfile sharedInstance].name forKey:@"Name"];
    [dictionaryDraw setObject:[JddUserProfile sharedInstance].password forKey:@"Password"];
    [dictionaryDraw setObject:money forKey:@"PayMoney"];
    [dictionaryDraw setObject:@"alipay_mobile" forKey:@"BankPay"];
    if ([appDelegate.moneyNum isEqualToString:@"100"]) {
        [dictionaryDraw setObject:@"1" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"1" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"1000"]){
        [dictionaryDraw setObject:@"2" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"1" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"98"]){
        [dictionaryDraw setObject:@"3" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"998"]){
        [dictionaryDraw setObject:@"4" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"9998"]){
        [dictionaryDraw setObject:@"5" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"29998"]){
        [dictionaryDraw setObject:@"6" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"59998"]){
        [dictionaryDraw setObject:@"7" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }else if ([appDelegate.moneyNum isEqualToString:@"99998"]){
        [dictionaryDraw setObject:@"8" forKey:@"HongBaoID"];
        [dictionaryDraw setObject:@"2" forKey:@"activeType"];
    }
    
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    if (i == 4 || [appDelegate.moneyNum isEqualToString:@"100"]||
        [appDelegate.moneyNum isEqualToString:@"1000"] ) {
        return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"108"];
    }else{
        return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"1082"];
    }
    
    
}

+(NSString*)queryBankCodeOperation
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:2];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"120"];
}


+(NSString*)queryfollowNumOfLotID:(NSString*)LotID pageNo:(NSString*)pageNo pageSize:(NSString*) pageSize
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:5];
    [dictionaryDraw setObject:LotID forKey:@"LotID"];
    [dictionaryDraw setObject:pageNo forKey:@"PageNo"];
    [dictionaryDraw setObject:pageSize forKey:@"PageSize"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"112"];
}

+(NSString*)queryfollowNumOfChaseID:(NSString*)ChaseID datasourceID:(NSString *)datasourceID
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:3];
    [dictionaryDraw setObject:ChaseID forKey:@"ChaseID"];
    [dictionaryDraw setObject:datasourceID forKey:@"DataSource"];

    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"113"];
}

+(NSString*)queryStopFollowOperation:(NSString *)ChaseID
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:3];
    [dictionaryDraw setObject:ChaseID forKey:@"ChaseID"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"114"];     
}
//调用老系统查询方案详情接口，等到新系统彻底切换好去掉
+(NSString*)queryBuyHistoryDetail:(NSString*)SchemeId
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:3];
    [dictionaryDraw setObject:[JddUserProfile sharedInstance].name forKey:@"Name"];
    [dictionaryDraw setObject:[JddUserProfile sharedInstance].password forKey:@"Password"];
    [dictionaryDraw setObject:SchemeId forKey:@"SchemeID"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"116"];
}

+(NSString*)queryBuyHistoryDetail:(NSString*)SchemeID DataSource:(NSString *)DataSource
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:3];
    if (DataSource == nil) {
        DataSource = @"1";
    }
    [dictionaryDraw setObject:SchemeID forKey:@"SchemeID"];
    [dictionaryDraw setObject:DataSource forKey:@"DataSource"];

    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"210"]; 
}

+(NSString *)queryBackOperation:(NSString *)backmessage contact:(NSString *)Contact
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:3];
    if ([[JddUserProfile sharedInstance].name length]>0) {
        [dictionaryDraw setObject:[JddUserProfile sharedInstance].name forKey:@"Name"];
    }else {
        [dictionaryDraw setObject:@"" forKey:@"Name"];
    }
    [dictionaryDraw setObject:@"bug反馈" forKey:@"Type"];
    [dictionaryDraw setObject:backmessage forKey:@"Suggestion"];
    [dictionaryDraw setObject:Contact forKey:@"Contact"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"115"];
}

+(NSString*)queryBuyHistory:(NSString *)LotID page:(NSNumber *)PageNo pagesize:(NSNumber *)PageSize
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:5];
    [dictionaryDraw setObject:LotID forKey:@"LotID"];
    [dictionaryDraw setObject:PageSize forKey:@"PageSize"];
    [dictionaryDraw setObject:PageNo forKey:@"PageNo"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"111"]; 
}
//开奖信息
+(NSString*)queryLotteryOpen
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:0];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    //300
    //modify by rain 使用玩球球开奖信息，参数中使userid为"";
//    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"300"];
    return [JddParameterBuilder buildParameterWithParameterJsonByOrgJdd:parameterValue actionCode:@"300"];
}

+(NSString*)queryLotteryOpenDetail:(NSString *)LotID
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryDraw setObject:LotID forKey:@"LottID"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    //modify by rain 使用玩球球开奖信息，参数中使userid为"";
//    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"301"];
    return [JddParameterBuilder buildParameterWithParameterJsonByOrgJdd:parameterValue actionCode:@"301"];
}

+(NSString*)queryLotteryrealDetail:(NSNumber*)LotID issue:(NSNumber*)IssueID
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:2];
    [dictionaryDraw setObject:LotID forKey:@"LottID"];
    [dictionaryDraw setObject:IssueID forKey:@"IssueID"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    //modify by rain 使用玩球球开奖信息，参数中使userid为"";
//    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"302"];
    return [JddParameterBuilder buildParameterWithParameterJsonByOrgJdd:parameterValue actionCode:@"302"];
}

+(NSString*)querySportOpenDetailOperation:(NSString*) MTime page:(int)PageNo pagesize:(int)PageSize actionCode:(NSString *)actionCode
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:1];
    NSString *timeKeyName = @"Time";
//    if ([actionCode isEqualToString:@"312"]) {
        timeKeyName = @"IssueID";
//    }
    
    [dictionaryDraw setObject:MTime forKey:timeKeyName];
    [dictionaryDraw setObject:[NSNumber numberWithInt:PageNo] forKey:@"PageNo"];
    [dictionaryDraw setObject:[NSNumber numberWithInt:PageSize] forKey:@"PageSize"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    //modify by rain 使用玩球球开奖信息，参数中使userid为"";
//    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:actionCode];
    return [JddParameterBuilder buildParameterWithParameterJsonByOrgJdd:parameterValue actionCode:actionCode];
}

+(NSString*)queryBBOpenDetailOperation:(NSString *)MTime action:(NSString *)Action
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryDraw setObject:MTime forKey:@"Time"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    //modify by rain 使用玩球球开奖信息，参数中使userid为"";
//    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:Action];
    return [JddParameterBuilder buildParameterWithParameterJsonByOrgJdd:parameterValue actionCode:Action];
}

+(NSString*)queryAlipayInfoOperation:(NSString *)alipayID
{
    NSString *parameterValue = [NSString stringWithFormat:@"{\"AlipayID\":%@}", alipayID];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"116"];
}
#pragma mark ===首页滚动广告的接口参数拼接
//首页滚动广告的接口参数拼接=====================ysy================ysy=======
//action=23&params={"platformTyp":5}
+(NSString *)adParameter:(NSString *)platformTyp
{
   // NSString *parameterValue = @"{playformTyp:6}";
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryDraw setObject:platformTyp forKey:@"platformTyp"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"24"];
}
//action=313&params={"LottID":90}
//获取竞彩足球篮球北单最近10期期次
+(NSString *)queryLastestTenIssueID:(NSString *)LotId
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryDraw setObject:LotId forKey:@"LottID"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJsonByOrgJdd:parameterValue actionCode:@"313"];
}

//首页滚动公告的接口参数拼接
+(NSString*)noticeParameter
{
    NSString *parameterValue = @"{CmdID:5,Count:100,PageNo:1,PageSize:100}";
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"21"];
}

//公告详情接口参数
+(NSString*)noticeDetailParameterWithNewID:(NSString *)NewID
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryDraw setObject:NewID forKey:@"NewID"];
    [dictionaryDraw setObject:@"6"  forKey:@"CmdID"];
    [dictionaryDraw setObject:@"5"  forKey:@"Count"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"22"];
}
//合买
+(NSString*)toghterBuyParameterWithPageNo:(int)PageNo AndPagesize:(int)pageSize AndOrderType:(int) OrderType AndOrderField:(int)OrderField AndLottID :(int)lottId
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryDraw setObject:[NSNumber numberWithInt:PageNo] forKey:@"PageNo"];
    [dictionaryDraw setObject:[NSNumber numberWithInt:pageSize] forKey:@"PageSize"];
    [dictionaryDraw setObject:[NSNumber numberWithInt:OrderType] forKey:@"OrderType"];
    [dictionaryDraw setObject:[NSNumber numberWithInt:OrderField] forKey:@"OrderField"];
    [dictionaryDraw setObject:[NSNumber numberWithInt:lottId] forKey:@"LottID"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
//    NSLog(@"合买 = %@",[JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"206"]);
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"206"];
}
//参与合买
+(NSString*)joinToghterBuyParameterWithSchemeID:(NSString *)SchemeID AndDataSource:(int)DataSource AndBuyShare:(int)BuyShare
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:1];
    [dictionaryDraw setObject:SchemeID forKey:@"SchemeID"];
    [dictionaryDraw setObject:[NSNumber numberWithInt:DataSource] forKey:@"DataSource"];
    [dictionaryDraw setObject:[NSNumber numberWithInt:BuyShare] forKey:@"BuyShare"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"209"];  //209 －》 212
}

+(NSString *)SendUserUniqueIdentifier
{
    CFUUIDRef uuid = CFUUIDCreate(NULL);
    CFStringRef uuidstring = CFUUIDCreateString(NULL, uuid);
    NSString *Ime = [NSString stringWithFormat:@"%@",uuidstring];
    //存入keychian
    [JddSFHFKeychainUtils storeUsername:USER_UUID andPassword:Ime forServiceName:USER_UUID updateExisting:1 error:nil];
    NSString *MMN = [self platform];
    NSString *OSV = [[UIDevice currentDevice] systemVersion];
    NSString *PV = [[NSBundle mainBundle].infoDictionary objectForKey:@"CFBundleVersion"];
    
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:1];
    [dic setObject:Ime forKey:@"Ime"];
    [dic setObject:MMN forKey:@"MMN"];
    [dic setObject:@"iPhone" forKey:@"MPN"];
    [dic setObject:OSV forKey:@"OSV"];
    [dic setObject:PV forKey:@"PV"];
    [dic setObject:@"" forKey:@"MNu"];
    NSString *parameterValue = [dic JSONString];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"3"];
}
#pragma mark 待发起方案列表
+(NSString*)queryInitiatePlanOperationUserId:(NSString*)userId pageNo:(NSString*)pageNo pageSize:(NSString*)pageSize
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:5];
    //[dictionaryDraw setObject:userId forKey:@"SchemeID"];
    [dictionaryDraw setObject:pageNo forKey:@"PageNo"];
    [dictionaryDraw setObject:pageSize forKey:@"PageSize"];
    
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"119"];
}

#pragma mark 待发起方案/订单详情
+(NSString *)initschemeDetailUserId:(NSString *)userId SchemeId:(NSString *)schemeId DataSource:(NSString *)dataSource{
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
    [dic setObject:schemeId forKey:@"SchemeID"];
    [dic setObject:dataSource forKey:@"DataSource"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dic];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"210"];
}

#pragma mark 发起方案订单
+(NSString *)sendSchemeOrderUserId:(NSString *)userId BuyShare:(NSString *)bs SchemeId:(NSString *)schemeId BonusScale:(NSString *)bonusScale{
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
    [dic setObject:schemeId forKey:@"SchemeID"];
    [dic setObject:bs forKey:@"BuyShare"];
    [dic setObject:bonusScale forKey:@"BonusScale"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dic];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"213"];
}


#pragma mark 代发起方案
+(NSString*)queryWithdrawCashOperationOldPw:(NSString*)newPw
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:5];
//    [dictionaryDraw setObject:oldPw forKey:@"oldPw"];
    [dictionaryDraw setObject:newPw forKey:@"newPw"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"130"];
}

+(NSString*)resetWithdrawCashOperationOldPw:(NSString*)oldPw newPw:(NSString*)newPw
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:5];
    [dictionaryDraw setObject:oldPw forKey:@"oldPw"];
    [dictionaryDraw setObject:newPw forKey:@"newPw"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"131"];
}

+ (NSString *) platform
{
    size_t size;
    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
    char *machine = malloc(size);
    sysctlbyname("hw.machine", machine, &size, NULL, 0);
    NSString *platform = [NSString stringWithCString:machine encoding:NSUTF8StringEncoding];
    free(machine);
    return platform;
}



#pragma mark --五联赛
+(NSString*)fiveMatchOpertaion
{
    NSMutableDictionary *dictionaryDraw = [NSMutableDictionary dictionaryWithCapacity:0];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryDraw];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"218"];
}

#pragma mark 找回密码
+(NSString *)lookForPasswordUsername:(NSString *)userName mobilephoneNum:(NSString *)phoneNum
{
    NSMutableDictionary *dictionaryFindPassword = [NSMutableDictionary dictionaryWithCapacity:2];
    [dictionaryFindPassword setObject:userName forKey:@"username"];
    [dictionaryFindPassword setObject:phoneNum forKey:@"mobile"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionaryFindPassword];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"1031"];
}
#pragma mark 提交验证码
+ (NSString *)simmitCode:(NSString *)verifyCode andUserName:(NSString *)userName
{
    NSMutableDictionary *dictionarysimmitCode = [NSMutableDictionary dictionaryWithCapacity:2];
    [dictionarysimmitCode setObject:verifyCode forKey:@"verifycode"];
    [dictionarysimmitCode setObject:userName forKey:@"username"];
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionarysimmitCode];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"1032"];
}

#pragma mark 修改密码
+ (NSString *)senUserName:(NSString *)username andPhoneNum:(NSString *)phoneNum andNewPwd:(NSString *)xinPwd
{
    NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:3];
    [dictionary setObject:username forKey:@"username"];
    [dictionary setObject:phoneNum forKey:@"mobile"];
    [dictionary setObject:xinPwd forKey:@"newpwd"];
    
    SBJsonWriter *jsonWriter = [[SBJsonWriter alloc] init];
    NSString *parameterValue = [jsonWriter stringWithObject:dictionary];
    return [JddParameterBuilder buildParameterWithParameterJson:parameterValue actionCode:@"1061"];
}

@end

